// 放置全局指令
import Vue from 'vue'
import store from '@/store'

// 管理员权限
const adminPerms = '*:*:*'

Vue.directive('auth-btn', {
  inserted(el, binding) {
    const perms = store.getters.profile.permissions
    if (!perms.includes(binding.value) && !perms.includes(adminPerms)) {
      el.remove()
    }
  }
})
